from tkinter import *
 
root = Tk()
root.title('1 этап МАРАФОН 2127')
root.geometry('500x500')
 
canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)
x=int(input("Введите координату Х начальной точки: "))
y=int(input("Введите координату Y начальной точки: "))
n=int(input("Введите коффициент увеличения: "))
if n==0 and 0<=x<=500 and 0<=y<=500: pass
elif n>0 and 0*n+x>=0 and 0*n+y>=0 and 20*n+x<=500 and 20*n+y<=500: pass
elif n<0 and 20*n+x>=0 and 20*n+y>=0 and 0*n+x<=500 and 0*n+y<=500: pass
else:
   print("Фигура превысила размеры поля")
   exit()
A = [0,0,20,0,20,20,40,20,40,40,20,40,20,60,0,60]
canvas.create_polygon(A[0]*n+x, A[1]*n+y,
                      A[2]*n+x, A[3]*n+y,
                      A[4]*n+x, A[5]*n+y,
                      A[6]*n+x, A[7]*n+y,
                      A[8]*n+x, A[9]*n+y,
                      A[10]*n+x, A[11]*n+y,
                      A[12]*n+x, A[13]*n+y,
                      A[14]*n+x, A[15]*n+y, fill='DarkBlue')
root.mainloop()
